Skip to content

Conversation

flavioislima
Copy link
Contributor

@flavioislima flavioislima commented Mar 12, 2025

This sustainability/tech PR moves most of ipcMain.on and all ipcMain.handle requests from main.ts to the ipcHandlers folder in specifc files asyncIpcHandlers and syncIpcHandlers, leading to a cleaner main.ts file with only important stuff and better redability and organization of the app files. I noticed some improvement in performance while in dev mode as well, but I cannot meassure by numbers (maybe placebo, maybe not 👀)

main.ts before => 2127 lines
main.ts after => 640 lines
Difference: 1487 lines

AI Summary

This pull request includes several changes to improve the backend functionality and correct a typo in the codebase. The most important changes include the addition of new IPC handlers, the correction of a typo in function names, and the implementation of a new function to check for game updates.

Backend Improvements:

  • src/backend/ipcHandlers/index.ts: Added imports for syncIpcHandlers and asyncIpcHandlers to handle synchronous and asynchronous IPC events.
  • src/backend/ipcHandlers/syncIpcHandlers.ts: Introduced a new file with multiple IPC event handlers to manage various backend operations such as focusing the main window, locking/unlocking the machine, opening URLs, setting zoom factors, and more.
  • src/backend/utils.ts: Added a new function checkGameUpdates to handle game updates and send notifications.

Typo Corrections:

How to Test

  • Regression test with Artifacts on all platforms

Use the following Checklist if you have changed something on the Backend or Frontend:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

@flavioislima flavioislima changed the title [Sustainability] Refactor IPC Handlers and move them from main.ts [Sust] Refactor IPC Handlers and move them from main.ts Mar 12, 2025
@flavioislima flavioislima added the PR: Ready-For-Review PR is ready to be reviewed by peers label Mar 12, 2025
Copy link
Collaborator

@BrettCleary BrettCleary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. we should probably do some regression testing on this one

@flavioislima flavioislima added PR: Ready-For-Test PR is ready to be tested by a QA and removed PR: Ready-For-Review PR is ready to be reviewed by peers labels Mar 13, 2025
Copy link

@nyghtstalker nyghtstalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed regression tests on all platforms and no issues were found. Great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Ready-For-Test PR is ready to be tested by a QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants